/* This file is part of xREL
 *
 * Copyright (C) 2012 Timo Zimmermann <xrel@timozimmermann.de>
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Library General Public
 * License as published by the Free Software Foundation; either
 * version 2 of the License, or (at your option) any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Library General Public License for more details.
 *
 * You should have received a copy of the GNU Library General Public License
 * along with this library; see the file COPYING.LIB.  If not, write to
 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
 * Boston, MA 02110-1301, USA.
 */

import QtQuick 1.1
import com.xrel 1.0
import "../components"
import "../js/HelperLib.js" as Helper

Item {
    id: root
    width: parent.width
    height: contentRow.height

    Column {
        id: contentRow
        width: parent.width
        height: childrenRect.height

        state: ext_info_type

        SectionLabel { text: qsTr("Release") }
        SectionEntry { titleText: qsTr("Dir-Name"); infoText: dirname }
        SectionEntry { titleText: qsTr("Product"); infoText: ext_info_title }

        SectionLabel { text: qsTr("Information") }

        Flow {
            width: parent.width
            SectionEntry {
                width: parent.width/2
                titleText: qsTr("Publish Date/Time")
                infoText: Helper.formatDateTime(pub_time, "dd.MM.yyyy hh:mm:ss")
            }
            SectionEntry {
                width: parent.width/2
                titleText: qsTr("Posting Date/Time")
                infoText: Helper.formatDateTime(post_time, "dd.MM.yyyy hh:mm:ss")
            }
            SectionEntry {
                width: parent.width/2
                titleText: qsTr("Size")
                infoText: size_mb + " MB"
            }
            SectionEntry {
                width: parent.width/2
                titleText: qsTr("Group")
                infoText: group_name
            }
            SectionEntry {
                id: seasonEntry
                width: parent.width/2
                titleText: qsTr("Season")
                infoText: tv_season
            }
            SectionEntry {
                id: episodeEntry
                width: parent.width/2
                titleText: qsTr("Episode")
                infoText: tv_episode
            }
        }

        SectionLabel { id: ratingLabel; text: qsTr("Release rating") }
        Row {
            id: ratingEntries
            width: parent.width
            height: childrenRect.height
            SectionEntry {
                id: totalVotesEntry
                width: parent.width/3
                titleText: qsTr("Total votes")
                infoText: num_ratings
            }
        }

        states: [
            State {
                name: "noMotionPicture"
                PropertyChanges { target: seasonEntry; visible: false}
                PropertyChanges { target: episodeEntry; visible: false }
                PropertyChanges { target: ratingLabel; visible: false}
                PropertyChanges { target: ratingEntries; visible: false }
                PropertyChanges { target: totalVotesEntry; visible: false }
            },
            State {
                name: "movie"
                PropertyChanges { target: seasonEntry; visible: false}
                PropertyChanges { target: episodeEntry; visible: false }
            },
            State {
                name: "tv"

            },
            State {
                name: "console"
                extend: "noMotionPicture"

            },
            State {
                name: "game"
                extend: "noMotionPicture"
            },
            State {
                name: "software"
                extend: "noMotionPicture"
            },
            State {
                name: "xxx"
                PropertyChanges { target: seasonEntry; visible: false}
                PropertyChanges { target: episodeEntry; visible: false }
            }
        ]
    }
}
